package com.ht.param.action;

import org.apache.struts2.ServletActionContext;

import com.ht.param.entity.ProjectTypeModel;
import com.ht.param.service.ProjecttypeService;
import com.ht.right.util.CommonUtil;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class ProjecttypeAction  extends ActionSupport implements ModelDriven<ProjectTypeModel>{
	private static final long serialVersionUID = -9082066643681726028L;
	private ProjectTypeModel projectTypeModel;
	private ProjecttypeService projecttypeService;

	public String findAllProjecttypeJson(){
		CommonUtil.toJsonStr(ServletActionContext.getResponse(), projecttypeService.loadAllList());
		return null;
	}
	
	
	@Override
	public ProjectTypeModel getModel() {
		if(CommonUtil.isNullOrEmpty(projectTypeModel)){
			projectTypeModel= new ProjectTypeModel();
		}
		return projectTypeModel;
	}

	public ProjectTypeModel getProjectTypeModel() {
		return projectTypeModel;
	}

	public void setProjectTypeModel(ProjectTypeModel projectTypeModel) {
		this.projectTypeModel = projectTypeModel;
	}

	public ProjecttypeService getProjecttypeService() {
		return projecttypeService;
	}

	public void setProjecttypeService(ProjecttypeService projecttypeService) {
		this.projecttypeService = projecttypeService;
	}

}
